#include<bits/stdc++.h>

using namespace std;
using ll=long long;
#define  endl  '\n'

/**
 * 计算约数之和O(sqrt(n))
 * @param n
 * @return
 */
ll f(ll n) {
    ll s = 1;
    for (ll i = 2; i * i <= n; i++) {
        if (n % i)continue;
        s += i;
        ll j = n / i;
        if (i != j)
            s += j;
    }
    return s;
}

int main() {
    ll a, b;
    cin >> a >> b;
    if (f(a) == b && f(b) == a) {
        cout << "yes" << endl;
    } else {
        cout << "no" << endl;
    }
    return 0;
}